﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace L2Sharp.Net.Packets.Core
{
    //TODO: Implement Packet Stuff from org.mmocore.network in L2J Source
    public abstract class SendablePacket : AbstractPacket
    {

        protected void writeC(int Data)
        {
            _buffWriter = new BinaryWriter(_buff);
            _buffWriter.Write(Data);
        }

        protected void writeF(double Data)
        {
            _buffWriter = new BinaryWriter(_buff);
            _buffWriter.Write(Data);
        }

        protected void writeH(int Data)
        {
            _buffWriter = new BinaryWriter(_buff);
            _buffWriter.Write(Data);
        }

        protected void writeD(int Data)
        {
            _buffWriter = new BinaryWriter(_buff);
            _buffWriter.Write(Data);
        }

        protected void writeQ(long Data)
        {
            _buffWriter = new BinaryWriter(_buff);
            _buffWriter.Write(Data);
        }

        protected void writeB(Byte[] Data)
        {
            _buffWriter = new BinaryWriter(_buff);
            _buffWriter.Write(Data);
        }

        protected void writeS(string Data)
        {
            if (Data != null)
            {
                _buffWriter = new BinaryWriter(_buff);
                _buffWriter.Write(Data);
            }
        }

        protected abstract void write();
    }

}
